package cn.tedu.api;

import java.util.Arrays;

// 测试 泛型的通用性
public class Test2_Generics {
    public static void main(String[] args) {
        //1 打印数组里的数据
        Integer []a = {1,2,3,4,5};
        Double []b = {1.1,2.2,3.3,4.4,5.5};
        String []c = {"张三","法外狂徒","李四"};
        print(a);
        print(b);
        print(c);


//        System.out.println(Arrays.toString(a));
//        System.out.println(Arrays.toString(b));
    }
    public static <E> void print(E[] a){
        for(E in :a ){
            System.out.println(in);
        }
    }
}
